package com.open.capacity.recuritment.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.open.capacity.common.model.SysRole;
import com.open.capacity.common.model.SysUser;
import com.open.capacity.common.web.Result;
import com.open.capacity.recuritment.Dto.IndustryDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface UnemployedDao extends BaseMapper<SysUser> {

    int count(Map<String, Object> params);


    List<SysUser> findUnemployed(Map<String, Object> params);

    /**
     *  根据用户ids 获取
     * @param userIds
     * @return
     */

    @Select("<script>select r.id  , r.code  ,r.name  , r.create_time createTime ,r.update_time updateTime ,ru.user_id userId from sys_role_user ru inner join sys_role r on r.id = ru.role_id where ru.user_id IN " +
            " <foreach item='item' index='index' collection='list' open='(' separator=',' close=')'> " +
            " #{item} " +
            " </foreach>" +
            "</script>")
    List<SysRole> findRolesByUserIds(List<Long> userIds);

    /**
     * 模糊检索行业
     * @param params
     * @return
     */
    List<SysUser> pSearch(Map<String, Object> params);
}
